import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus';
import 'element-plus/lib/theme-chalk/index.css';
import axios from 'axios'
import VueAxios from 'vue-axios'

//引入中文库
import locale from 'element-plus/lib/locale/lang/zh-cn'
//引入富文本编辑器
import CKEditor from '@ckeditor/ckeditor5-vue'

//引入css
import './assets/css/global.css'
//配置请求的基准地址
axios.defaults.baseURL = `http://127.0.0.1:8888/api/private/v1/`

//配置请求头，每次发送请求，都设置一个使用‘Authorization’ 字段提供‘token’令牌
axios.interceptors.request.use((config)=>{
  config.headers.Authorization = sessionStorage.getItem('token');
  return config;
})
createApp(App).use(ElementPlus,{locale}).use(store).use(router).use(VueAxios, axios).use(CKEditor).mount('#app')
